package com.example.publishdemo.publishservice.event;

import com.example.publishdemo.publishservice.enums.PublishServicesType;
import org.springframework.context.ApplicationEvent;

/**
 * 异步事件
 * 该类重写的必要性
 * 使用自定义的event 我们可以携带一些参数
 * 比如，比如服务名称标识
 * 比如，一些必要参数。。等等等
 */
public class MyPublishEventForAsync  extends ApplicationEvent implements MyPublishEvent{

    private PublishServicesType publishServicesType;
    private String message;

    public MyPublishEventForAsync(Object source, PublishServicesType publishServicesType, String message) {
        super(source);
        this.publishServicesType = publishServicesType;
        this.message = message;
    }

    public PublishServicesType getPublishServicesType() {
        return publishServicesType;
    }

    public void setPublishServicesType(PublishServicesType publishServicesType) {
        this.publishServicesType = publishServicesType;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
